package f.f0.g;

import f.s;
import g.e;
import g.j;
import g.y;
import java.io.IOException;

/* compiled from: CallServerInterceptor */
public final class b implements s {
    public final boolean a;

    /* compiled from: CallServerInterceptor */
    public static final class a extends j {
        public long b;

        public a(y yVar) {
            super(yVar);
        }

        public void E(e eVar, long j) throws IOException {
            this.a.E(eVar, j);
            this.b += j;
        }
    }

    public b(boolean z) {
        this.a = z;
    }

    /* JADX WARNING: Missing block: B:32:0x010d, code skipped:
            if (r3.equalsIgnoreCase(r7) != false) goto L_0x010f;
     */
    public f.a0 intercept(f.s.a r11) throws java.io.IOException {
        /*
        r10 = this;
        r11 = (f.f0.g.f) r11;
        r0 = r11.c;
        r1 = r11.b;
        r2 = r11.d;
        r3 = r11.f;
        r4 = java.lang.System.currentTimeMillis();
        r6 = r11.h;
        java.util.Objects.requireNonNull(r6);
        r0.b(r3);
        r6 = r11.h;
        java.util.Objects.requireNonNull(r6);
        r6 = r3.b;
        r6 = c.j.a.c.y.a.i.E(r6);
        r7 = 0;
        if (r6 == 0) goto L_0x007c;
    L_0x0024:
        r6 = r3.d;
        if (r6 == 0) goto L_0x007c;
    L_0x0028:
        r6 = r3.c;
        r8 = "Expect";
        r6 = r6.c(r8);
        r8 = "100-continue";
        r6 = r8.equalsIgnoreCase(r6);
        if (r6 == 0) goto L_0x0046;
    L_0x0038:
        r0.d();
        r6 = r11.h;
        java.util.Objects.requireNonNull(r6);
        r6 = 1;
        r6 = r0.f(r6);
        goto L_0x0047;
    L_0x0046:
        r6 = r7;
    L_0x0047:
        if (r6 != 0) goto L_0x0072;
    L_0x0049:
        r2 = r11.h;
        java.util.Objects.requireNonNull(r2);
        r2 = r3.d;
        r8 = r2.contentLength();
        r2 = new f.f0.g.b$a;
        r8 = r0.e(r3, r8);
        r2.m8395init(r8);
        r8 = g.q.a;
        r8 = new g.t;
        r8.m8405init(r2);
        r2 = r3.d;
        r2.writeTo(r8);
        r8.close();
        r2 = r11.h;
        java.util.Objects.requireNonNull(r2);
        goto L_0x007d;
    L_0x0072:
        r2 = r2.h();
        if (r2 != 0) goto L_0x007d;
    L_0x0078:
        r1.f();
        goto L_0x007d;
    L_0x007c:
        r6 = r7;
    L_0x007d:
        r0.a();
        r2 = 0;
        if (r6 != 0) goto L_0x008c;
    L_0x0083:
        r6 = r11.h;
        java.util.Objects.requireNonNull(r6);
        r6 = r0.f(r2);
    L_0x008c:
        r6.a = r3;
        r8 = r1.b();
        r8 = r8.f;
        r6.e = r8;
        r6.k = r4;
        r8 = java.lang.System.currentTimeMillis();
        r6.l = r8;
        r6 = r6.b();
        r8 = r6.c;
        r9 = 100;
        if (r8 != r9) goto L_0x00c4;
    L_0x00a8:
        r2 = r0.f(r2);
        r2.a = r3;
        r3 = r1.b();
        r3 = r3.f;
        r2.e = r3;
        r2.k = r4;
        r3 = java.lang.System.currentTimeMillis();
        r2.l = r3;
        r6 = r2.b();
        r8 = r6.c;
    L_0x00c4:
        r11 = r11.h;
        java.util.Objects.requireNonNull(r11);
        r11 = r10.a;
        if (r11 == 0) goto L_0x00df;
    L_0x00cd:
        r11 = 101; // 0x65 float:1.42E-43 double:5.0E-322;
        if (r8 != r11) goto L_0x00df;
    L_0x00d1:
        r11 = new f.a0$a;
        r11.m4704init(r6);
        r0 = f.f0.c.c;
        r11.g = r0;
        r11 = r11.b();
        goto L_0x00ee;
    L_0x00df:
        r11 = new f.a0$a;
        r11.m4704init(r6);
        r0 = r0.c(r6);
        r11.g = r0;
        r11 = r11.b();
    L_0x00ee:
        r0 = r11.a;
        r0 = r0.c;
        r2 = "Connection";
        r0 = r0.c(r2);
        r3 = "close";
        r0 = r3.equalsIgnoreCase(r0);
        if (r0 != 0) goto L_0x010f;
    L_0x0100:
        r0 = r11.f;
        r0 = r0.c(r2);
        if (r0 == 0) goto L_0x0109;
    L_0x0108:
        r7 = r0;
    L_0x0109:
        r0 = r3.equalsIgnoreCase(r7);
        if (r0 == 0) goto L_0x0112;
    L_0x010f:
        r1.f();
    L_0x0112:
        r0 = 204; // 0xcc float:2.86E-43 double:1.01E-321;
        if (r8 == r0) goto L_0x011a;
    L_0x0116:
        r0 = 205; // 0xcd float:2.87E-43 double:1.013E-321;
        if (r8 != r0) goto L_0x0126;
    L_0x011a:
        r0 = r11.g;
        r0 = r0.n();
        r2 = 0;
        r4 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));
        if (r4 > 0) goto L_0x0127;
    L_0x0126:
        return r11;
    L_0x0127:
        r0 = new java.net.ProtocolException;
        r1 = "HTTP ";
        r2 = " had non-zero Content-Length: ";
        r1 = c.b.a.a.a.h(r1, r8, r2);
        r11 = r11.g;
        r2 = r11.n();
        r1.append(r2);
        r11 = r1.toString();
        r0.<init>(r11);
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: f.f0.g.b.intercept(f.s$a):f.a0");
    }
}
